<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
<?php
require_once 'Zend/Controller/Action.php';
require_once 'Zend/Auth.php';
require_once 'Zend/Auth/Adapter/DbTable.php';

class UserController extends Zend_Controller_Action
{
  public function init() {
     $links = array (  "scripts/menu_assets/styles.css", "styles/css/home.css", "scripts/jgraph/library/themes/ui-lightness/jquery.ui.theme.css",  "scripts/jgraph/library/themes/base/jquery.ui.tabs.css", "scripts/jgraph/library/themes/base/jquery.ui.all.css", "scripts/jgraph/library/themes/base/jquery.ui.autocomplete.css",  "scripts/jgraph/library/themes/base/jquery.ui.accordion.css", "scripts/jgraph/library/themes/base/jquery.ui.all.css","scripts/jgraph/library/themes/base/jquery.ui.base.css", "scripts/jgraph/library/themes/base/jquery.ui.button.css", "scripts/jgraph/library/themes/base/jquery.ui.core.css", "scripts/jgraph/library/themes/base/jquery.ui.datepicker.css", "scripts/jgraph/library/themes/base/jquery.ui.dialog.css", "scripts/jgraph/library/themes/base/jquery.ui.progressbar.css", "scripts/jgraph/library/themes/base/jquery.ui.resizable.css", "scripts/jgraph/library/themes/base/jquery.ui.selectable.css", "scripts/jgraph/library/themes/base/jquery.ui.slider.css",  "scripts/jgraph/library/themes/base/jquery.ui.theme.css", "scripts/jgraph/library/themes/ui-lightness/jquery-ui-1.8.16.custom.css", "scripts/jgraph/library/themes/ui-lightness/jquery.ui.accordion.css", "scripts/jgraph/library/themes/ui-lightness/jquery.ui.all.css", "scripts/jgraph/library/themes/ui-lightness/jquery.ui.autocomplete.css", "scripts/jgraph/library/themes/ui-lightness/jquery.ui.base.css", "scripts/jgraph/library/themes/ui-lightness/jquery.ui.button.css", "scripts/jgraph/library/themes/ui-lightness/jquery.ui.core.css", "scripts/jgraph/library/themes/ui-lightness/jquery.ui.datepicker.css", "scripts/jgraph/library/themes/ui-lightness/jquery.ui.dialog.css", "scripts/jgraph/library/themes/ui-lightness/jquery.ui.progressbar.css", "scripts/jgraph/library/themes/ui-lightness/jquery.ui.resizable.css", "scripts/jgraph/library/themes/ui-lightness/jquery.ui.selectable.css", "scripts/jgraph/library/themes/ui-lightness/jquery.ui.slider.css", "scripts/jgraph/library/themes/ui-lightness/jquery.ui.tabs.css", "scripts/jgraph/styles/diagram.css","scripts/jgraph/styles/demos.css");
		foreach ( $links as $val ) {
			$url = $this->view->baseUrl ( $val );
			$this->view->headLink ()->appendStylesheet ( $url );
		}
        $scripts = array ("scripts/jgraph/library/jquery-1.6.2.min.js", "scripts/jgraph/library/ui/minified/jquery.ui.core.min.js", "scripts/jgraph/library/ui/minified/jquery.ui.widget.min.js", "scripts/jgraph/library/ui/minified/jquery.ui.mouse.min.js", "scripts/jgraph/library/ui/minified/jquery.ui.draggable.min.js", "scripts/jgraph/library/ui/minified/jquery.ui.resizable.min.js", "scripts/jgraph/library/ui/minified/jquery.ui.droppable.min.js", "scripts/jgraph/library/ui/minified/jquery.ui.button.min.js","scripts/jgraph/scripts/wz_jsgraphics.js" , "scripts/jgraph/scripts/jgraphui.js", "scripts/jquery/jquery.form.js");		
        foreach ( $scripts as $key => $val ) {
			if (is_array ( $val )) {
				$url = $this->view->baseUrl ( $key );
				$this->view->headScript ()->appendFile ( $url, 'javascript', $val );
			} else {
				$url = $this->view->baseUrl ( $val );
				$this->view->headScript ()->appendFile ( $url, 'text/javascript' );
			}  
                }
   } 
  public function homeAction()
  {
     
      $request = $this->getRequest();
        $auth = Zend_Auth::getInstance();
        if (!$auth->hasIdentity()) {
            $this->_redirect("http://localhost");
        } else {
            $this->_redirect('/user/home');
        }
     $data = $this->getRequest()->getParam('data');
      echo $data;
      
       
  }
  
  public function monitoringAction()
  {
  
  
  }

}

?>
